package remote.utils
{
	import flash.display.DisplayObject;
	import flash.display.DisplayObjectContainer;
	
	/**
	 * 显示对象辅助
	 * @author 银魂飞雪
	 * @createDate 2011-2-26
	 */
	public class DisplayObjectUtil
	{
		public static function centerX(o:DisplayObject):void
		{
			if(o.parent != null)
			{
				o.x = (o.parent.width - o.width) / 2;
			}
		}
		
		public static function centerY(o:DisplayObject):void
		{
			if(o.parent != null)
			{
				o.y = (o.parent.height - o.height) / 2;
			}
		}
		
		public static function getChildren(container:DisplayObjectContainer):Array
		{
			var result:Array = new Array();
			for(var i:int = 0; i < container.numChildren; i++)
			{
				result.push(container.getChildAt(i));
			}
			return result;
			
			
			
		}
	}
}